package celiasoft.itasalib.structures;

import java.util.ArrayList;
import java.util.List;

public class MyItasaShow extends DataElement {
	
	private List<SubsVersion> _vers;
	
	public MyItasaShow(int showId, String showName) {
		super(showId,showName);
		this.setVersionsOfAvailableSubs(new ArrayList<SubsVersion>());
	}
	
	public MyItasaShow(int showId) {
		this(showId, null);
	}

	/**
	 * @return the version of all available subs
	 */
	public List<SubsVersion> getVersionOfAvailableSubs() {
		return _vers;
	}

	/**
	 * @param subsVersions the version list to set
	 */
	public void setVersionsOfAvailableSubs(List<SubsVersion> subsVersion) {
		_vers = subsVersion;
	}
	
	public boolean isSubsVersionAvailable(SubsVersion version){
		if(version != null){
			for(SubsVersion v:this.getVersionOfAvailableSubs()){
				if(v.getLabel().compareTo(version.getLabel()) == 0){
					return true;
				}
			}
		}
			
		return false;
	}

	
}
